package com.jd.jdmvc.template.action;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.jd.jdmvc.template.model.PinShenPO;
import com.jd.mvc.core.controller.annotation.MethodType;
import com.jd.mvc.core.controller.annotation.Route;
import com.jd.mvc.core.controller.annotation.MethodType.mType;
import com.jd.mvc.core.util.MvcPageContextUtil;

@Route("/pinshen")
public class LPTestController {

	@Route(value = "/pinshenChild.html")
	@MethodType(type = mType.get)
	public String lpDemo() throws Exception{
		List<PinShenPO> pinShenList = new ArrayList<PinShenPO>();

		PinShenPO pinShen = new PinShenPO();
		pinShen.setId("1");
		pinShen.setName("No.1");
		pinShenList.add(pinShen);

		PinShenPO pinShen1 = new PinShenPO();
		pinShen1.setId("2");
		pinShen1.setName("No.2");
		pinShenList.add(pinShen1);

		PinShenPO pinShen2 = new PinShenPO();
		pinShen2.setId("3");
		pinShen2.setName("No.3");
		pinShenList.add(pinShen2);

		HttpServletRequest request = MvcPageContextUtil.getRequest();
		request.setAttribute("PinShenList", pinShenList);
		return "pinshen.jd";
	}
}
